home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tpc10.arc / TPCMAC.H < prev   
Text File  |  1988-10-23  |  1KB  |  58 lines

  1.  
  2. /*
  3.  * TPCMAC.H - Macro Header for use with Turbo Pascal --> C Translator
  4.  *
  5.  * S.H.Smith, 22-Dec-86
  6.  *
  7.  */
  8.  
  9. #include <stdio.h>
  10.  
  11. #define keypressed     kbhit()
  12. #define upcase(c)      toupper(c)
  13. #define length(s)      strlen(s)
  14. #define dispose(v)     free(v)
  15. #define chr(n)         (n)
  16. #define ord(c)         (c)
  17. #define false          0
  18. #define true           1
  19.  
  20. #define THRU           -2
  21. #define ENDSET         -1
  22.  
  23.  
  24. /*
  25.  * support library functions:
  26.  *
  27.  *   setof(a,b,...,-1)
  28.  *      construct and return a set of the specified character values
  29.  *
  30.  *   inset(ex,set)
  31.  *      predicate returns true if expression ex is a member of
  32.  *      the set parameter
  33.  *
  34.  *   copy(dstr,from,len)
  35.  *      copy len bytes from the dynamic string dstr starting at offset from
  36.  */
  37.  
  38. /*
  39.  *  concatenate str1 and str2 and return a pointer to the
  40.  *  static result.   note that str1 or str2 may point to the
  41.  *  concat static buffer.
  42.  */
  43. char *concat(s1,s2)
  44. char *s1;
  45. char *s2;
  46. {
  47.    static char buf[255];
  48.    char ts2[255];
  49.  
  50.    strcpy(ts2,s2);    /* this is needed because either s1 or s2 could
  51.                          already point to buf! */
  52.    strcpy(buf,s1);
  53.    strcat(buf,ts2);
  54.  
  55.    return buf;
  56. }
  57.  
  58.